<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>宜宾学院学生证书综合管理系统</title>

    <link href="/yibinu_certificate/static/assets/css/icon.css" rel="stylesheet">
    <link rel="stylesheet" href="/yibinu_certificate/static/assets/materialize/css/materialize.min.css" media="screen,projection" />
    <!-- Bootstrap Styles-->
    <link href="/yibinu_certificate/static/assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="/yibinu_certificate/static/assets/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="/yibinu_certificate/static/assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/yibinu_certificate/static/assets/css/custom-styles.css" rel="stylesheet" />
    <link rel="stylesheet" href="/yibinu_certificate/static/assets/js/Lightweight-Chart/cssCharts.css">

    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="/yibinu_certificate/static/assets/js/jquery-3.3.1.js"></script>

    <!-- Bootstrap Js -->
    <script src="/yibinu_certificate/static/assets/js/bootstrap.min.js"></script>

    <script src="/yibinu_certificate/static/assets/materialize/js/materialize.min.js"></script>

    <!-- Metis Menu Js -->
    <script src="/yibinu_certificate/static/assets/js/jquery.metisMenu.js"></script>
    <!-- Morris Chart Js -->
    <script src="/yibinu_certificate/static/assets/js/morris/raphael-2.1.0.min.js"></script>
    <script src="/yibinu_certificate/static/assets/js/morris/morris.js"></script>


    <script src="/yibinu_certificate/static/assets/js/easypiechart.js"></script>
    <script src="/yibinu_certificate/static/assets/js/easypiechart-data.js"></script>

    <script src="/yibinu_certificate/static/assets/js/Lightweight-Chart/jquery.chart.js"></script>

</head>

<body>
<c:if test="${empty user}">
    <script type="text/javascript">
        alert('您还未登录，请先登录！！！');
        window.location.href = '/yibinu_certificate/login';
    </script>
</c:if>
<div id="wrapper">
    <nav class="navbar navbar-default top-navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle waves-effect waves-dark" data-toggle="collapse" data-target=".sidebar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand waves-effect waves-dark" href="">
                <!--<i class="large material-icons">track_changes</i>-->
                <img  style="display: inline-block;width: 30px;height: 30px" src="/yibinu_certificate/static/assets/img/yibinu_logo.png">
                <strong>证书管理</strong>
            </a>
        </div>

        <ul class="nav navbar-top-links navbar-right">
            <li>
                <a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1">
                    <i class="fa fa-user fa-fw"></i>
                    <c:choose>
                        <c:when test="${user.role == 'student'}">
                            <b>学生：${user.student.stuName}</b>
                        </c:when>
                        <c:when test="${user.role == 'teacher'}">
                            <b>辅导员：${user.teacher.teacherName}</b>
                        </c:when>
                        <c:otherwise>
                            <b>分管领导：${user.leader.teacherName}</b>
                        </c:otherwise>
                    </c:choose>
                    <i class="material-icons right">arrow_drop_down</i>
                </a>
            </li>
        </ul>
    </nav>
    <!-- Dropdown Structure -->
    <ul id="dropdown1" class="dropdown-content">
        <li>
            <a href="/yibinu_certificate/login/password"><i class="fa fa-sign-out fa-fw"></i>修改密码</a>
        </li>
        <li>
            <a href="/yibinu_certificate/login/userLogout"><i class="fa fa-sign-out fa-fw"></i>退出登录</a>
        </li>
    </ul>
    <!--/. NAV TOP  -->
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">
                <c:choose>
                    <c:when test="${user.role == 'leader'}">
                        <li>
                            <a href="/yibinu_certificate/index/" class="waves-effect waves-dark"><i class="fa fa-desktop"></i>首页</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/school/list" class="waves-effect waves-dark"><i class="fa fa-qrcode"></i>二级学院信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/student/list" class="waves-effect waves-dark" ><i class="fa fa-user-o"></i>学生信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/teacher/list" class="waves-effect waves-dark"><i class="fa fa-id-card"></i>教师信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/major/list" class="waves-effect waves-dark"><i class="fa fa-magic"></i>专业信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/studentPrize/list" class="waves-effect waves-dark"><i class="fa fa-table"></i>获奖信息管理</a>
                        </li>

                        <li>
                            <a href="#" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>获奖管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="/yibinu_certificate/prizeGrade/list">获奖等级管理</a>
                                </li>
                                <li>
                                    <a href="/yibinu_certificate/prizeLevel/list">获奖级别管理</a>
                                </li>
                                <li>
                                    <a href="/yibinu_certificate/prizeName/list">获奖名称管理</a>
                                </li>
                            </ul>
                        </li>
                    </c:when>
                    <c:when test="${user.role == 'teacher'}">
                        <li>
                            <a href="/yibinu_certificate/index/" class="waves-effect waves-dark"><i class="fa fa-desktop"></i>首页</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/student/list" class="waves-effect waves-dark" ><i class="fa fa-user-o"></i>学生信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/teacher/list" class="waves-effect waves-dark"><i class="fa fa-id-card"></i>教师信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/studentPrize/list" class="waves-effect waves-dark"><i class="fa fa-table"></i>获奖信息管理</a>
                        </li>
                    </c:when>
                    <c:otherwise>
                        <li>
                            <a href="/yibinu_certificate/index/" class="waves-effect waves-dark"><i class="fa fa-desktop"></i>首页</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/student/list" class="waves-effect waves-dark" ><i class="fa fa-user-o"></i>学生信息管理</a>
                        </li>

                        <li>
                            <a href="/yibinu_certificate/studentPrize/list" class="waves-effect waves-dark"><i class="fa fa-table"></i>获奖信息管理</a>
                        </li>
                    </c:otherwise>
                </c:choose>

            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->
</div>
<script>
    (function ($) {
        "use strict";
        var mainApp = {

            initFunction: function () {
                /*MENU
                ------------------------------------*/
                $('#main-menu').metisMenu();

                $(window).bind("load resize", function () {
                    if ($(this).width() < 768) {
                        $('div.sidebar-collapse').addClass('collapse')
                    } else {
                        $('div.sidebar-collapse').removeClass('collapse')
                    }
                });

            },

            initialization: function () {
                mainApp.initFunction();

            }

        }
        // Initializing ///

        $(document).ready(function () {
            $(".dropdown-button").dropdown();
            $("#sideNav").click(function(){
                if($(this).hasClass('closed')){
                    $('.navbar-side').animate({left: '0px'});
                    $(this).removeClass('closed');
                    $('#page-wrapper').animate({'margin-left' : '260px'});

                }
                else{
                    $(this).addClass('closed');
                    $('.navbar-side').animate({left: '-260px'});
                    $('#page-wrapper').animate({'margin-left' : '0px'});
                }
            });

            mainApp.initFunction();
        });

        $(".dropdown-button").dropdown();

    }(jQuery));
</script>
</body>
</html>